﻿@model SoftHotel.Models.DetalleReservaHab

@{
    ViewBag.Title = "Agregar Detalle";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Crear detalle</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<link href="@Url.Content("~/Content/themes/base/jquery.ui.core.css")"  
        rel="stylesheet" type="text/css" /> 
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.datepicker.css")"  
        rel="stylesheet"  type="text/css" /> 
    <link href="@Url.Content("~/Content/themes/base/jquery.ui.theme.css")"  
        rel="stylesheet" type="text/css" /> 
 
    <script src="@Url.Content("~/Scripts/jquery.ui.core.js")"  
        type="text/javascript"></script> 
    <script src="@Url.Content("~/Scripts/jquery.ui.datepicker.js")"  
        type="text/javascript"></script> 
        <script src="@Url.Content("~/Scripts/jquery.validate.js")"  
        type="text/javascript"></script> 
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>    
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
    

<script type="text/javascript">
    $(document).ready(function () {



        $('.date').datepicker
        ({

            dayNamesMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa"],
            monthNames: ["January", "February", "March", "April", "Mayo", "Junio", "Julio", "August", "September", "October", "November", "December"],
            dateFormat: 'dd/mm/yy',
            minDate: 0

        });
    });
</script>

<script type="text/javascript">

    var linkObj;
    $(function () {
        $(".busqueda").button();

        $('#searchDialog').dialog({
            autoOpen: false,
            width: 900,
            resizable: false,
            modal: true
            //            buttons: {
            //                
            //                "Cancel": function () {
            //                    $(this).dialog("close");
            //                }
            //            }
        });

        $(".busqueda").click(function () {
            //change the title of the dialgo
            linkObj = $(this);
            var dialogDiv = $('#searchDialog');
            var viewUrl = linkObj.attr('href');
            $.get(viewUrl, function (data) {
                dialogDiv.html(data);

                //open dialog
                dialogDiv.dialog('open');
            });
            return false;
        });

    });


    function searchSuccess() {
        var id = $("#update-message").html();
        //we update the table's info
        var parent = linkObj.closest("tr");
        document.getElementById('idAmbiente').value = $("#idAmbiente" + id.toString()).val();
        document.getElementById('nombreAmbiente').value = $("#nombre" + id.toString()).val();

        //now we can close the dialog
        $('#searchDialog').dialog('close');
    }
</script>

 <div id="searchDialog" title="Buscar Ambiente"></div>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>

        <legend>Detalle de Reserva</legend>
          @Html.HiddenFor(model => model.idReserva)
         
         <table id="MainContent_Table1" rules="none" style="border-color: Black; width: 900px; margin-bottom: 0px;">
	<tbody>
    <tr>
	  <td style="width: 20px;"></td>
	  <td style="font-weight: bold;">Número Item</td>
	  <td><div class="editor-field">
            @Html.EditorFor(model => model.numeroItem)
            @Html.ValidationMessageFor(model => model.numeroItem)
        </div> </td>
	  
	</tr>
    <tr>
	  <td style="width: 20px;"></td>
	  <td style="font-weight: bold;">ID Ambiente </td>
	  <td> 
          
           @Html.TextBoxFor(model => model.idAmbiente)
       
        <a class="busqueda" href="/ReservaHab/BuscarAmbiente"> <img src="/Content/Images/buscar.png" alt="0" title="Buscar" id="" border="0" height="16" width="16"/></a>         
	  </td>
	</tr>
    <tr>
	  <td style="width: 20px;"></td>
	  <td style="font-weight: bold;">Ambiente </td>
	  <td>           
           @Html.TextBoxFor(model => model.nombreAmbiente, new { disabled = "disabled" })
      </td>
	  
	</tr>

    <tr>
	  <td style="width: 20px;"></td>
	  <td style="font-weight: bold;">Precio Unitario</td>
	  <td><div class="editor-field">
              @Html.TextBoxFor(model => model.precioUnitario, new { disabled = "disabled" })
        </div> </td>
	  
	</tr>
    <tr>
	  <td style="width: 20px;"></td>
	  <td style="font-weight: bold;">Cantidad</td>
	  <td><div class="editor-field">
              @Html.TextBoxFor(model => model.cantidad)
        </div> </td>
	  
	</tr>
    <tr>
	  <td style="width: 20px;"></td>
	  <td style="font-weight: bold;">Total</td>
	  <td><div class="editor-field">
              @Html.TextBoxFor(model => model.total, new { disabled = "disabled" })
        </div> </td>
	  
	</tr>
	
</tbody></table>       
        <p>
            <input type="submit" name="button" value="Guardar" />           
        </p>
 
    </fieldset>

}

   @using (Html.BeginForm("Editar","ReservaHab",FormMethod.Get))
{
        
        <p>
            @Html.HiddenFor(model => model.idReserva)
    
            <input type="submit" value="Volver" />  
        </p> 
}


